package com.spark3

import java.io.FileWriter

object CreateMocData {

  def main(args: Array[String]): Unit = {

    def getRandomInt = (new util.Random).nextInt(5000000)
    def getRandomChar = (0x4e00 + (Math.random * (0x9fa5 - 0x4e00 + 1)).toInt).toChar

    //  /Users/tanweihua/Desktop/123.txt
    val content:StringBuilder = new StringBuilder()
    val fileWriter = new FileWriter("/Users/tanweihua/Desktop/123.txt",true)

    val arr = List("谭伟华","罗兰","fdf","fsfser","cxxce","xxxx","efsf","成约需","付电话费很深刻的浪费",
    "fdsfksdlfrregdgdfgsdg","唱过长度","你是衣蛾地方","浮点数","可以的","这是一个人","外面是一个圈套","但是不坑",
    "学学","谢谢参与测试","毕业工业","附近的开始放假看电视了房间安防监控来得及发大水加法等","媳妇解放军副科级卡萨放假看人家分开发的进口量时代峰峻",
    "fhdjsfhjskd","fdsfhjds官方是否合适款到发货闪电发货","返回的几号放假都是废话","分段函数费近段时间","发动机是否还记得书法家",
    "返回的技术分解大煞风景","的计算孵化基地书法家","dhjsfhjdsfh发动机复活甲")

    for (i <- 1 to 200000000){
      // val randomNum = (new util.Random).nextInt(16)
      content.append(arr(0))
      // content.append(getRandomChar + getRandomInt.toString)
      content.append("\n")
    }

//    for (i <- 1 to 100000){
//      val randomNum = (new util.Random).nextInt(arr.length - 1)
//      content.append(arr(randomNum))
//      // content.append(getRandomChar + getRandomInt.toString)
//      content.append("\n")
//    }

    fileWriter.write(content.mkString)
    fileWriter.close()

  }
}
